class Man {
  name: string;
  constructor(name: string) {
    this.name = name;
  }
  say(): void {
    console.log('My name is ' + this.name);
  }
}

let jack: Man = new Man('jack');
console.log(jack.name);
jack.say();